<?php


namespace app\queue\stomp;


use app\queue\BaseConsumer;
use common\service\EntityService;

/**
 * 同步概念集关系到资产
 * Class CalculateEntityManHourConsumer
 * @package app\queue\redis
 */
class SyncDesignEpisodeRelationToAssetConsumer extends BaseConsumer
{
    // 要消费的队列名
    public $queue = 'sync_design_episode_relation_to_asset';

    // 连接名，对应 config/redis_queue.php 里的连接`
    public $connection = 'default';

    public function doConsume($data)
    {
        try {
            $entityService = EntityService::getInstance();
            $entityService->designEpisodeRelationToAsset($data['filter']);
        } catch (\Throwable $e) {
            trace(format_exception_info($e), 'ERR');
        }
    }
}
